
package jdec.jdt.ls.decompiler.common.util;

import jdec.jdt.ls.decompiler.common.JavaDecompilerPlugin;

public class Logger {

	public static void debug(String message, Throwable throwable) {
		try {
			if (message != null) {
				System.err.println(message);
			}
			if (throwable != null) {
				throwable.printStackTrace();
			}
		} catch (Exception localException) {
			if (message != null)
				System.err.println(message);
			if (throwable != null)
				throwable.printStackTrace();
		}
	}

	public static void info(String message) {
		if (message != null) {
			JavaDecompilerPlugin.logInfo(message);
		}
	}

	public static void error(String message) {
		if (message != null) {
			JavaDecompilerPlugin.logError(null, message);
		}
	}

	public static void error(String message, Throwable t) {
		if (message != null) {
			JavaDecompilerPlugin.logError(t, message);
		}
	}

	public static void debug(Throwable throwable) {
		throwable.printStackTrace();
	}

	public static void error(Throwable t) {
		if (t != null) {
			JavaDecompilerPlugin.logError(t, t.getMessage());
		}
	}
}
